package com.example.scroll_view

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.ScrollView
import android.widget.TextView

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

//        val scrollView = findViewById<ScrollView>(R.id.scrollView1)

        val linearLayout1 = findViewById<LinearLayout>(R.id.ll)
        val scrollView = ScrollView(this)

        linearLayout1.addView(scrollView)

        val linearLayout2 = LinearLayout(this)
        linearLayout2.orientation = LinearLayout.VERTICAL

        scrollView.addView(linearLayout2)

        val imageView = ImageView(this)
        imageView.setImageResource(R.drawable.head01)

        linearLayout2.addView(imageView)

        val textView = TextView(this)
        textView.setText(R.string.content)
        textView.textSize = 56f

        linearLayout2.addView(textView)


    }
}
